Repository navigation
Parse the wait flags in the library, and refresh the options after the wait - #116
Merged
Merged
Conversation
…e wait JourneyWait.Parse reads the --wait-for flags once for snap and any tool built on JourneyConsoleRunner. Operators and the attribute separator are found outside quotes and brackets, so a selector such as a[href='mailto:[email protected]'] needs no escaping. Preconditions now run before the journeys are planned, and RefreshAfterPreconditions lets the caller read the site's flags again once the wait is met. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Review of the first consumer (elastic/docs-builder#4885) found two gaps in #115.
--wait-forsyntax was parsed insidesnap's CLI, so a tool built onJourneyConsoleRunnerhad to copy it. docs-builder did, and the copy had the same bug: it split a selector at any@, soa[href='mailto:[email protected]']==Contactbecame an invalid selector plus an attribute. Quoted text could also hold an operator.What
JourneyWait.Parse(JourneyWaitFlags)returns aJourneyWaitParse(preconditions, or a plain-text problem).snap journey run/comparecall it, and so can any tool. The operators==,=~and=*and the attribute@are found outside quotes and brackets.JourneyRunOptions.RefreshAfterPreconditionsreturns the options the run uses once the wait is met, so@requires,featureblocks and the skips use the refreshed flags. Without preconditions nothing changes. The wait now also happens when every journey would be skipped.Verification
Full suite passes (1297). New tests cover quoted
@and quoted operators, the options, bad input, the refresh (a journey skipped before it runs after it), no refresh when a wait is unmet, and the wait happening first. Reverting the@rule to a plain last-@split made two tests fail; restored.🤖 Generated with Claude Code